<%- bundle ||= bundle_row -%>

<div class="<%= cycle('light', 'dark') %> clearfix">
	<h3>
	  <span id="<%= dom_id(bundle, 'title') %>"><%= bundle.title %></span>
	  <%= link_to_function 'Edit title', nil, :id => dom_id(bundle, 'edit_title'), :class => 'small' %>
	  (<%= bundle.current_bundlings.count %> postings)
	</h3>
  <%= link_to_function 'Edit notes', nil, :id => dom_id(bundle, 'edit_notes'), :class => 'small' %>
	<p id="<%= dom_id(bundle, 'notes') %>"><%= bundle.notes %></p>
	<p>
	  <%= link_to_function "Show postings", "new Effect.toggle('#{dom_id(bundle, 'postings')}', 'slide', {duration: 0.6})" %>
	  |
	  <%= link_to 'Edit Postings', postings_path(:bundle_id => bundle) %>
	</p>
	<div id="<%= dom_id(bundle, 'postings') %>" class="small_bundle_list" style="display: none">
		<ol>
	  <%- bundle.postings.each do |posting| -%>
		  <li>
		    <h6><%= posting.title %></h6>
		    <div>
    			<span class="amount_requested">$<%= posting.amount_requested %></span>
    			@
    			<span class="borrower_rate"><%= percentage(posting.borrower_rate) %></span>
		    </div>
		  </li>
		<%- end -%>
		</ol>
	</div>
</div>

<%= partial 'bundle_in_place_edit', bundle %>
